package com.zmt.content.feignClient;

import com.zmt.xuechengplusbase.model.RestResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@Component
public class MediaServiceFallBackFactory implements FallbackFactory<MediaServiceClient> {
    @Override
    public MediaServiceClient create(Throwable throwable) {
        return new MediaServiceClient() {
            @Override
            public String upload(MultipartFile file, String objectName) {
                log.error("熔断降级处理，错误信息{}",throwable.toString(),throwable);
                return null;
            }
        };
    }
}
